﻿#region

using Microsoft.Xna.Framework;

using Pob.GameObjects.PowerUps.General;

#endregion

namespace Pob.GameObjects.PowerUps.Special
{
    internal class PaddleSizePowerUp : PowerUp
    {
        #region Fields

        private PaddleSizePowerUpEffect _effect;

        #endregion

        #region Constructors and Destructors

        public PaddleSizePowerUp(Game game, string assetName, Vector2 position, float sizeFactor, PowerUpCreator creator)
            : base(game, assetName, position, sizeFactor, creator)
        {
        }

        #endregion

        #region Public Methods and Operators

        public override void ActivateEffect(Player owner, GameTime gameTime)
        {
            if (Game.Components.Contains(this))
            {
                Game.Components.Remove(this);
            }

            _effect = new PaddleSizePowerUpEffect(Game, this, owner, (float)gameTime.TotalGameTime.TotalSeconds, 10);

            _effect.OnActivation();

            Game.Components.Add(_effect);
        }

        public override void DeactivateEffect()
        {
            _effect.OnDeactivation();

            Game.Components.Remove(_effect);
        }

        #endregion
    }
}